bug 21282 &unhide=1 on next/prev diff links if already viewing the diff
authorAaron Schulz <aaron@users.mediawiki.org>
Wed, 28 Oct 2009 06:37:51 +0000 (06:37 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Wed, 28 Oct 2009 06:37:51 +0000 (06:37 +0000)
includes/Article.php
includes/diff/DifferenceInterface.php

index 09bb46d..e1f172a 100644 (file)
@@ -3370,6 +3370,11 @@ class Article {
                        return;
                }
 
+               # Cascade unhide param in links for easy deletion browsing
+               $extraParams = array();
+               if( $wgRequest->getVal('unhide') ) {
+                       $extraParams['unhide'] = 1;
+               }
                $revision = Revision::newFromId( $oldid );
 
                $current = ( $oldid == $this->mLatest );
@@ -3383,7 +3388,7 @@ class Article {
                                $this->mTitle,
                                wfMsgHtml( 'currentrevisionlink' ),
                                array(),
-                               array(),
+                               $extraParams,
                                array( 'known', 'noclasses' )
                        );
                $curdiff = $current
@@ -3395,7 +3400,7 @@ class Article {
                                array(
                                        'diff' => 'cur',
                                        'oldid' => $oldid
-                               ),
+                               ) + $extraParams,
                                array( 'known', 'noclasses' )
                        );
                $prev = $this->mTitle->getPreviousRevisionID( $oldid ) ;
@@ -3407,7 +3412,7 @@ class Article {
                                array(
                                        'direction' => 'prev',
                                        'oldid' => $oldid
-                               ),
+                               ) + $extraParams,
                                array( 'known', 'noclasses' )
                        )
                        : wfMsgHtml( 'previousrevision' );
@@ -3419,7 +3424,7 @@ class Article {
                                array(
                                        'diff' => 'prev',
                                        'oldid' => $oldid
-                               ),
+                               ) + $extraParams,
                                array( 'known', 'noclasses' )
                        )
                        : wfMsgHtml( 'diff' );
@@ -3432,7 +3437,7 @@ class Article {
                                array(
                                        'direction' => 'next',
                                        'oldid' => $oldid
-                               ),
+                               ) + $extraParams,
                                array( 'known', 'noclasses' )
                        );
                $nextdiff = $current
@@ -3444,7 +3449,7 @@ class Article {
                                array(
                                        'diff' => 'next',
                                        'oldid' => $oldid
-                               ),
+                               ) + $extraParams,
                                array( 'known', 'noclasses' )
                        );
 
index 6fffa49..35f8542 100644 (file)
@@ -273,7 +273,10 @@ CONTROL;
                # Make "previous revision link"
                $query['diff'] = 'prev';
                $query['oldid'] = $this->mOldid;
-
+               # Cascade unhide param in links for easy deletion browsing
+               if( $this->unhide ) {
+                       $query['unhide'] = 1;
+               }
                $prevlink = $sk->link(
                        $this->mTitle,
                        wfMsgHtml( 'previousdiff' ),
@@ -286,10 +289,11 @@ CONTROL;
                                'noclasses'
                        )
                );
+
                # Make "next revision link"
                $query['diff'] = 'next';
                $query['oldid'] = $this->mNewid;
-
+               # Skip next link on the top revision
                if( $this->mNewRev->isCurrent() ) {
                        $nextlink = '&nbsp;';
                } else {